<section class="vbox">
      <header class="header bg-success bg-gradient">
        <p>Application</p>
      	<button class="btn btn-sm btn-white pull-right" onClick="javascript:location.href='<?php echo SITE_URL ?>/app/add'"> <i class="icon-plus text"></i> <span class="text">Add new</span></button>
      </header>
      <div class="row">
      	<div class="col-lg-12">
      		<!-- .breadcrumb -->
      		<ul class="breadcrumb"> <li><a href="<?php echo SITE_URL ?>"><i class="icon-home"></i>Home</a></li> <li class="active"><a href="<?php echo SITE_URL ?>/category"><i class="icon-folder-close"></i>Application</a></li>
      		</ul>
      		<!-- / .breadcrumb -->
      	</div>
  		</div>
      <form action="" method="post">
      <section class="panel">
      	<?php if($msg): ?>
      	<div class="alert alert-success" style="margin-bottom:0px;"> <button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button> <i class="icon-ok-sign"></i> <?php echo $msg; ?> </div>
      	<?php endif; ?>
		<div class="table-responsive">
			<table class="table table-striped b-t text-sm">
				<thead>
					<tr>
						<th width="20"><input type="checkbox"></th>
            <th>Title</th>
						<th width="80">Thumbnail</th>
            <th width="70">Order</th>
						<th width="50">Target</th>
						<th width="70">Activate</th>
					</tr>
					<?php if(!empty($app['data'])): ?>
          <?php $activate = "";$target = ""; ?>
            <?php foreach($app['data'] as $application): ?>
              <?php
              if($application["app_activate"] > 0){
                $activate = "<i class='icon-eye-open' title='Active'></i>";
              }
              else{
                $activate = "<i class='icon-eye-close' title='Inactive'></i>";
              }
              if($application["app_target"] == 'IFRAME'){
                $target = '<i class="icon-code" title="Iframe"></i>';
              }
              else{
                $target = "<i class='icon-external-link' title='New window'></i>";
              }
              ?>
              <tr onMouseOver='this.style.background="lavender"' onMouseOut='this.style.background=""'>
                <td><input type="checkbox" name="items[]" value="<?php echo $application['app_id'] ?>"></td>
                <td style="font-size:12px;"><?php echo $application['app_title'] ?></td>
                <td><?php if($application['app_thumbnail'] != '') echo '<a href="'.$application['app_thumbnail'].'" target="_blank"><img src="'.$application['app_thumbnail'].'" style="border:solid 1px #ccc;" height="50" /></a>'; ?></td>
                <td><input class='input-sm form-control' style='width:40px;height:21px;text-align:center;' onClick='this.select()' type='text' name='app_order[<?php echo $application["app_id"] ?>]' value='<?php echo $application["app_order"] ?>' /></td>
                <td align="center"><?php echo $target; ?></td>
                <td align="center"><?php echo $activate; ?></td>
              </tr>
            <?php endforeach; ?>
          <?php endif; ?>
				</thead>
			</table>
		</div>
		<footer class="panel-footer">
			<div class="row"> <div class="col-sm-4 hidden-xs"> <select class="input-sm form-control input-s-sm inline" name="cmd"> <option value="0">Bulk action</option> <option value="delete">Delete selected</option> <option value="reorder">Re-order</option></select> <button class="btn btn-sm btn-white" type="submit">Apply</button> </div></div>
		</footer>
      </section>
	</form>
</section>